package com.example.springcachedemo.dao.jdbc;

import com.example.springcachedemo.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

/**
 * @author lzh
 * @date 2020/2/27 - 9:39
 */
@Component
public class UserJdbcTemplate   {

    @Autowired
    JdbcTemplate jdbcTemplate;


    public int addUser(User user) {
        return jdbcTemplate.update("insert into sys_user (username,address) values (?,?);", user.getUsername(), user.getAddress());
    }







}
